The purpose of this notebook is to introduce the Jupyter interface. This notebook is a guide to the Jupyter interface and writing code and text in Jupyter notebooks with the Python programming language and Markdown, the lightweight markup language.
This notebook was originally created for a Digital Mixer session at the 2016 STELLA Unconference
In [2]:
# create a range of numbers
numbers = range(0, 5)
# print out each of the numbers in the range
for number in numbers:
print(number)
Click on any text above to see what cell it belongs to. The active cell will be surrounded by a green or blue outline. A green outline indicates you are in edit mode for that cell and you can type in the cell. A blue outline indicates that you are in command mode and you cannot type in the active cell. To enter edit mode in a cell click on any code input area or double-click on any rendered Markdown text.
Notice that you can see the content type of the active cell in the multi-choice button in the notebook toolbar at the top of the page:
You can also use this button to change the cell type.
You can manage cells using the notebook toolbar.
Edit > Delete Cells
Try adding a new Markdown cell and a Code cell, moving them around, and deleting them. If you accidentally delete something you shouldn't have, you can undo it by going to: Edit > Undo Delete Cells
To run code in a cell or to render markdown as html in a cell you must run the cell.
To run the contents of a cell:
shift
+return
or click in the notebook toolbar at the top of the page.Try running the three Python code cells below. You can edit and re-run a cell as many times as you want.
In [ ]:
# this is Python code -> RUN IT
x = 2
# the output of the last line of code is shown below the cell
x * x
In [ ]:
# this is Python code -> RUN IT
x = 2
# you can also use the 'print' statement to print information to the output below the cell
print(x)
# the output of the last line of code is still shown below the cell
x * x
In [ ]:
# this is Python code -> RUN IT
x = 2
# if there is an error in your code an error message will display in the output below the cell
x + "two"
Try editing and adding some text this Markdown cell
Double-click on this text to start
when you are done press shift+return
to run
For an overview of Markdown format check out Markdown Cheatsheet
Help > User Interface Tour
for a quick, guided overview of the user interface.You should have a basic understanding of how to navigate an interactive notebook, the cell types, how to manipulate cells (adding, moving, removing, etc.), and how to run cells.
Next: For a basic overview of data analysis and visualization with pandas and matplotlib, download the following notebook and add it to your notebooks folder by uploading it in the Notebook dashboard: http://nbviewer.jupyter.org/github/WaltGurley/jupyter-notebooks-intro/blob/master/Jupyter%20-%20coding%20with%20Python.ipynb